<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/baseSistema.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core">

    

    <ui:define name="content">
         #{homeController.accesoURL(false, "/categoria/index")}
        <f:view>
            <h:form>
                
                <p:dataTable id="dataTable" var="item" value="#{categoriaController.listado()}"
                             paginator="true" rows="10" rowsPerPageTemplate="5,10,15">
                    <f:facet name="header">  
                        CATEGORIAS 
                    </f:facet>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="ID"/>
                        </f:facet>
                        <h:outputText value="#{item.id}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="NOMBRE"/>
                        </f:facet>
                        <h:outputText value="#{item.nombre}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="DESCRIPCION"/>
                        </f:facet>
                        <h:outputText value="#{item.descripcion}"/>
                    </p:column>
                    
                    <p:column>
                        <f:facet name="header"> <h:outputText value=""/> </f:facet>
                        <h:commandLink action="#{categoriaController.editar(item.id)}">
                            <h:graphicImage library="images" name="edit.png" title="editar"/>
                        </h:commandLink>
                    </p:column>

                    <p:column>
                        <f:facet name="header"> <h:outputText value=""/> </f:facet>
                        <h:commandLink action="#{categoriaController.eliminar(item.id)}">
                            <h:graphicImage library="images" name="delete.png" title="eliminar"/>
                        </h:commandLink>
                    </p:column>
                </p:dataTable>
                <p:commandButton value="NUEVO" action="#{categoriaController.nuevo}" ajax="false"/>
                
            </h:form>
        </f:view>

    </ui:define>
    

</ui:composition>
